<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">

    <h3>
        <#if custom>修改自定义参数<#else>添加自定义参数</#if>
    </h3>
 
</div>
<div class="pad10A">
<#if custom> 
<form id="demo-form1" action="/custom/update/${custom.id}" class="col-md-12" method="POST">
<#else>
<form id="demo-form1" action="/custom/add" class="col-md-12" method="POST">
</#if>

	<#if custom>
	<input type="hidden" name="id" value="${custom.id}"/>
	</#if>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            备注:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-10">
	        <input type="text" id="memo" name="memo" data-trigger="change" data-required="true" class="parsley-validated" value="${custom.memo}"></textarea>
	    </div>
	</div>
	
   <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                参数:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-10">
            <input type="text" id="code" name="code" data-trigger="change" data-required="true" class="parsley-validated" value="${custom.code}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                值:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-10">
            <textarea  id="value" rows="22" name="value" data-trigger="change" data-required="true" class="parsley-validated" value="${custom.value}">${custom.value}</textarea>
        </div>
    </div>
    
    <div class="divider"></div>
    <div class="form-row">
        <input type="hidden" name="superhidden" id="superhidden">
       <div class="form-input col-md-10 col-md-offset-2">
                    <a href="javascript:;" class="btn medium primary-bg radius-all-4 col-md-2" id="demo-form-2-valid">提交</a>
        </div>
    </div>   

</form>
</div>
</div>


<script type="text/javascript">

$(function(){
    
	$("#demo-form-2-valid").click(function(){
		$('#demo-form1').parsley('validate');
	    $('#demo-form1').trigger('submit');
	});
});

</script>